
import React from 'react'
import { connect } from 'dva-no-router'
import { bindActionCreators } from 'redux'

import UI from '../components/photograph';

class App extends React.Component {
  render() {
    return (
      <UI {...this.props}/>
    )
  }
}

const actions = {
  // upload: (val) => ({type: 'photo/upload', payload:val}),
  cleanImages:(val1,val2)=> ({type:'photo/cleanImages',payload:{url:val1,photoType:val2}}),
  thisPhotoOpen:(val) => ({type:'photo/thisPhotoOpen',payload:val}),
  thisPhotoClose:() => ({type:'photo/thisPhotoClose'}),
  thisPressIn: (val) => ({type: 'photo/thisPressIn', payload: val}),
  thisPressOut: (val, val2) => ({type: 'photo/thisPressOut', payload: {url: val, photoType: val2}}),
  thisAlertClose: () => ({type: 'photo/thisAlertClose'})
};

const mapProps = ({photo}) => ({...photo});

const mapActions = dispatch => ({
  ...bindActionCreators({...actions}, dispatch)
});

export default connect(mapProps, mapActions)(App)